/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pt.iscte.iul.dcti.pa.gspas.model;

import java.util.List;
import pt.iscte.iul.dcti.pa.gspas.gui.annotation.ComponentLabelAnnotation;

/**
 * @author Gedsimon Pereira - 58554
 * @contact gspas@iscte.pt
 * 
 */
public class Student {

    private String name;
    private int number;
    private boolean worker;
    private List<Grade> grades;

    public Student() {
    }

    public Student(String name, int number) {
        super();
        this.name = name;
        this.number = number;
    }
    

    @ComponentLabelAnnotation(label = "Name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    @ComponentLabelAnnotation(label = "Number")
    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }
    
    @ComponentLabelAnnotation(label = "Worker")
    public boolean isWorker() {
        return worker;
    }

    public void setWorker(boolean worker) {
        this.worker = worker;
    }
    
    @ComponentLabelAnnotation(label = "Grades")
    public List<Grade> getGrades() {
        return grades;
    }

    public void setGrades(List<Grade> grades) {
        this.grades = grades;
    }
    
    public void addGrade(Assignment assignment, Mark mark){
        if(grades != null){
            grades.add(new Grade(mark, assignment));
        }
    }

    @Override
    public String toString() {
        return "Student{" + "Name: " + name + ", Number: " + number + '}';
    }
    
    
}
